HtmlHelper<TModel>
Assembly: ServiceStack.Razor.dll
View Source
Declaration
public class HtmlHelper<TModel> : HtmlHelper, IHtmlContext
Properties
ViewData
View Source
Declaration
public ViewDataDictionary<TModel> ViewData { get; }
Inherited Properties
ClientValidationEnabled
View Source
Declaration
public static bool ClientValidationEnabled { get; set; }
HttpRequest
View Source
Declaration
public IHttpRequest HttpRequest { get; set; }
HttpResponse
View Source
Declaration
public IHttpResponse HttpResponse { get; set; }
MarkdownPage
View Source
Declaration
public MarkdownPage MarkdownPage { get; protected set; }
RazorPage
View Source
Declaration
public IRazorView RazorPage { get; protected set; }
ScopeArgs
View Source
Declaration
public Dictionary<string, object> ScopeArgs { get; protected set; }
UnobtrusiveJavaScriptEnabled
View Source
Declaration
public static bool UnobtrusiveJavaScriptEnabled { get; set; }
ViewBag
View Source
Declaration
public dynamic ViewBag { get; }
ViewContext
View Source
Declaration
public ViewContext ViewContext { get; }
ViewData
View Source
Declaration
public ViewDataDictionary ViewData { get; protected set; }
ViewDataContainer
View Source
Declaration
public IViewDataContainer ViewDataContainer { get; }
ViewEngine
View Source
Declaration
public IViewEngine ViewEngine { get; set; }
Writer
View Source
Declaration
public StreamWriter Writer { get; set; }
Inherited Methods
AnonymousObjectToHtmlAttributes(Object)
View Source
Declaration
public static RouteValueDictionary AnonymousObjectToHtmlAttributes(object htmlAttributes)
Returns
ServiceStack.Html.RouteValueDictionary
Parameters
Type | Name |
---|---|
System.Object | htmlAttributes |
AntiForgeryToken()
View Source
Declaration
public MvcHtmlString AntiForgeryToken()
Returns
ServiceStack.Html.MvcHtmlString
AntiForgeryToken(String)
View Source
Declaration
public MvcHtmlString AntiForgeryToken(string salt)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | salt |
AntiForgeryToken(String, String, String)
View Source
Declaration
public MvcHtmlString AntiForgeryToken(string salt, string domain, string path)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | salt |
System.String | domain |
System.String | path |
AttributeEncode(Object)
View Source
Declaration
public string AttributeEncode(object value)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | value |
AttributeEncode(String)
View Source
Declaration
public string AttributeEncode(string value)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | value |
Debug(Object)
View Source
Declaration
public string Debug(object model)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | model |
EnableClientValidation()
View Source
Declaration
public void EnableClientValidation()
EnableClientValidation(Boolean)
View Source
Declaration
public void EnableClientValidation(bool enabled)
Parameters
Type | Name |
---|---|
System.Boolean | enabled |
EnableUnobtrusiveJavaScript()
View Source
Declaration
public void EnableUnobtrusiveJavaScript()
EnableUnobtrusiveJavaScript(Boolean)
View Source
Declaration
public void EnableUnobtrusiveJavaScript(bool enabled)
Parameters
Type | Name |
---|---|
System.Boolean | enabled |
Encode(Object)
View Source
Declaration
public string Encode(object value)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | value |
Encode(String)
View Source
Declaration
public string Encode(string value)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | value |
FormatValue(Object, String)
View Source
Declaration
public string FormatValue(object value, string format)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | value |
System.String | format |
GenerateIdFromName(String)
View Source
Declaration
public static string GenerateIdFromName(string name)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | name |
GenerateIdFromName(String, String)
View Source
Declaration
public static string GenerateIdFromName(string name, string idAttributeDotReplacement)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | name |
System.String | idAttributeDotReplacement |
GetErrorMessage()
View Source
Declaration
public MvcHtmlString GetErrorMessage()
Returns
ServiceStack.Html.MvcHtmlString
GetErrorStatus()
View Source
Declaration
public ResponseStatus GetErrorStatus()
Returns
ResponseStatus
GetFieldError(String)
View Source
Declaration
public ResponseError GetFieldError(string errorName)
Returns
ResponseError
Parameters
Type | Name |
---|---|
System.String | errorName |
GetFormMethodString(FormMethod)
View Source
Declaration
public static string GetFormMethodString(FormMethod method)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Html.FormMethod | method |
GetInputTypeString(InputType)
View Source
Declaration
public static string GetInputTypeString(InputType inputType)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Html.InputType | inputType |
GetMethod(String)
View Source
Declaration
public static MethodInfo GetMethod(string methodName)
Returns
System.Reflection.MethodInfo
Parameters
Type | Name |
---|---|
System.String | methodName |
GetUnobtrusiveValidationAttributes(String)
View Source
Declaration
public IDictionary<string, object> GetUnobtrusiveValidationAttributes(string name)
Returns
System.Collections.Generic.IDictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
System.String | name |
GetUnobtrusiveValidationAttributes(String, ModelMetadata)
View Source
Declaration
public IDictionary<string, object> GetUnobtrusiveValidationAttributes(string name, ModelMetadata metadata)
Returns
System.Collections.Generic.IDictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
System.String | name |
ServiceStack.Html.ModelMetadata | metadata |
HasFieldError(String)
View Source
Declaration
public bool HasFieldError(string errorName)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | errorName |
HttpMethodOverride(HttpVerbs)
View Source
Declaration
public MvcHtmlString HttpMethodOverride(HttpVerbs httpVerb)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
ServiceStack.Html.HttpVerbs | httpVerb |
HttpMethodOverride(String)
View Source
Declaration
public MvcHtmlString HttpMethodOverride(string httpMethod)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | httpMethod |
IncludeFile(String)
View Source
Declaration
public MvcHtmlString IncludeFile(string virtualPath)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | virtualPath |
Init(IHttpRequest, IHttpResponse, IViewEngine, ViewDataDictionary, HtmlHelper)
View Source
Declaration
public void Init(IHttpRequest httpReq, IHttpResponse httpRes, IViewEngine viewEngine, ViewDataDictionary viewData, HtmlHelper htmlHelper)
Parameters
Type | Name |
---|---|
IHttpRequest | httpReq |
IHttpResponse | httpRes |
ServiceStack.Html.IViewEngine | viewEngine |
ServiceStack.Html.ViewDataDictionary | viewData |
ServiceStack.Html.HtmlHelper | htmlHelper |
Init(IViewEngine, IRequest, IResponse, IRazorView, Dictionary<String, Object>, ViewDataDictionary)
View Source
Declaration
public void Init(IViewEngine viewEngine, IRequest httpReq, IResponse httpRes, IRazorView razorPage, Dictionary<string, object> scopeArgs = null, ViewDataDictionary viewData = null)
Parameters
Type | Name |
---|---|
ServiceStack.Html.IViewEngine | viewEngine |
IRequest | httpReq |
IResponse | httpRes |
ServiceStack.Html.IRazorView | razorPage |
System.Collections.Generic.Dictionary<System.String,System.Object> | scopeArgs |
ServiceStack.Html.ViewDataDictionary | viewData |
Init(MarkdownPage, Dictionary<String, Object>, Boolean, ViewDataDictionary, HtmlHelper)
View Source
Declaration
public void Init(MarkdownPage markdownPage, Dictionary<string, object> scopeArgs, bool renderHtml, ViewDataDictionary viewData, HtmlHelper htmlHelper)
Parameters
Type | Name |
---|---|
ServiceStack.Support.Markdown.MarkdownPage | markdownPage |
System.Collections.Generic.Dictionary<System.String,System.Object> | scopeArgs |
System.Boolean | renderHtml |
ServiceStack.Html.ViewDataDictionary | viewData |
ServiceStack.Html.HtmlHelper | htmlHelper |
Partial(String)
View Source
Declaration
public MvcHtmlString Partial(string viewName)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | viewName |
Partial(String, Object)
View Source
Declaration
public MvcHtmlString Partial(string viewName, object model)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | viewName |
System.Object | model |
Raw(Object)
View Source
Declaration
public MvcHtmlString Raw(object content)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.Object | content |
RenderAction(String, String)
View Source
Declaration
public MvcHtmlString RenderAction(string route, string viewName = null)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | route |
System.String | viewName |
RenderMarkdownToHtml(String)
View Source
Declaration
public MvcHtmlString RenderMarkdownToHtml(string markdown)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | markdown |
SetModel(Object)
View Source
Declaration
public void SetModel(object model)
Parameters
Type | Name |
---|---|
System.Object | model |